import math
def sum(a, b):
    return (a+ b)
def sub(a,b):
    return (a- b)
def mul(a,b):
    return (a* b)
def div(a,b):
    return (a/ b)

def mod(a,b):
    return (a% b)
def sin(a, b):

    print("sin(a + b) = ", round(math.sin(math.radians(a+b)), 2))
    print("sin(a - b) = ", round(math.sin(math.radians(a-b)), 2))


def cos(a, b):

    print("cos(a + b) = ", round(math.cos(math.radians(a+b)), 2))
    print("cos(a - b) = ", round(math.cos(math.radians(a-b)), 2))

def tan(a, b):

    print("tan(a + b) = ", round(math.tan(math.radians(a+b)), 2))
    print("tan(a - b) = ", round(math.tan(math.radians(a-b)), 2))

def log(a,b):
    if b == 0:
        print("Error")
        return 0
    return math.log(b,a)




print("======================欢迎使用DKYBestI计算器=======================")
print("||                    作者:20231318 傅述令                       ||")
print("||                    开发时间:2024/3/27                         ||")
print("||                    Coprtight(C) : 2024 by BESTI              ||")
print("||                    联系方式 : 304375209@qq.com                 ||")
print("===================================================================")
flag = True
while flag:
    a = eval(input("请输入a:"))
    b = eval(input("请输入b:"))
    operator = input("请输入运算符(+-*/ sin cos tan  log):")
    if operator == "+":
        print("a+b = ", sum(a, b))
    elif operator == "-":
        print("a-b = ", sub(a, b))
    elif operator == "*":
        print("a*b =", mul(a, b))
    elif operator == "/":
        if b == 0:
            print("ZeroDivisionError: division by zero")
        else:
            print("a/b =", div(a, b))
    elif operator == "%":
        print("a%b = ", mod(a, b))
    elif operator == "sin":
        sin(a, b)
    elif operator == "cos":
        cos(a, b)
    elif operator == "tan":
        tan(a, b)
    elif operator == "log":
        print("以a为底b的对数log a b：", log(a, b))
    else:
        print("符号输入有误，请重新输入！！！")
    flag = False if input("是否要继续？Y or N\n") == "N" else True